#pragma once
#include <google/protobuf/service.h>
#include <vector>
#include "Controller.h"
namespace emoney {
    class ServiceManager {
      public:
        ServiceManager();
        ~ServiceManager();

      public:
        static ServiceManager& instance();

      public:
        void add_service(google::protobuf::Service* pService);


        const google::protobuf::MethodDescriptor* getMethod(const std::string &methodName);

        bool makeMessage(const std::string& methodName,
                         google::protobuf::Message* &pbMsgReq,
                         google::protobuf::Message* &pbMsgResp,
                         google::protobuf::Service* & service,
                         const google::protobuf::MethodDescriptor* & md);
      protected:

        std::vector< google::protobuf::Service*> m_sevices;
    };
}
